// layoutable implementation for GtkWidget
// Copyright 2006 (C) Ralph Thomas

#ifndef MISSION_VIEW_GTK_LAYOUTABLE_H
#define MISSION_VIEW_GTK_LAYOUTABLE_H

#include <adobe/eve.hpp>
#include <adobe/future/widgets/headers/gtk/os_utilities.hpp>

namespace view {
	//
	/// Simple wrapper around GtkWidget for simple layout
	/// cases.
	//
	struct layoutable_widget_t {
		GtkWidget*	target_m;
		layoutable_widget_t(GtkWidget* target) : target_m(target) {}
		layoutable_widget_t(const layoutable_widget_t& rhs) : target_m(rhs.target_m) {}
		void measure(adobe::extents_t& extents) {
			extents = adobe::implementation::best_bounds_widget(target_m);
		}
		void place(const adobe::place_data_t& place) {
			adobe::implementation::set_bounds_widget(target_m, place);
		}
		bool operator==(const layoutable_widget_t& rhs) {
			return target_m == rhs.target_m;
		}
	};

};

#endif

